package com.jiujiu.utitls;


import com.google.common.base.Preconditions;
import org.apache.log4j.Logger;

import java.io.File;

/**
 * @author ZhaoJunZhou
 * @Date 2020/10/9
 */
public  class MyFiles {
    public static final Logger log = Logger.getLogger(MyFiles.class);
    public static Boolean hasFile(String path) {
        File file = new File(path);
        return file.exists();
    }
    public static Boolean hasFile(File file) {
        if (file == null) {
            return false;
        }
        return file.exists();
    }
    public static File getFile(String path) {
        File file = new File(path);
        Preconditions.checkArgument(file.exists(),"未找到"+path);
        return file;
    }
}
